//
//  UIImage+ImageCategory.m
//  XiangMu
//
//  Created by 吕超 on 16/11/15.
//  Copyright © 2016年 lc. All rights reserved.
//

#import "UIImage+ImageCategory.h"

@implementation UIImage (ImageCategory)

// 修改图片大小
- (UIImage *)initWithImage:(UIImage *)image scaleToSize:(CGSize)size {
//    image = [[UIImage alloc]init];
    
    UIGraphicsBeginImageContext(size);  //size 为CGSize类型，即你所需要的图片尺寸
    
    [image drawInRect:CGRectMake(0, 0, size.width, size.height)];
    
    UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();
    
    return scaledImage;   //返回的就是已经改变的图片
}


@end
